Skip to content

Remove sbt-scalajs-bundler dependency - #755

Open
rleibman wants to merge 2 commits into
masterfrom
remove-scalajs-bundler-dependency
Open

Remove sbt-scalajs-bundler dependency#755
rleibman wants to merge 2 commits into
masterfrom
remove-scalajs-bundler-dependency

Conversation

@rleibman

@rleibman rleibman commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Removes the sbt-scalajs-bundler dependency from sbt-converter. It has no sbt 2.0/Scala 3 build and looks dormant — it was blocking a move to sbt 2.0, but sbt-converter never actually used its bundling features (JS resource hooks were already stubbed to Nil), only its npm-dependency-declaration and npm install plumbing.
  • Adds a small self-contained NpmInstall task (sbt-converter/.../internal/NpmInstall.scala) that writes package.json and runs npm install/yarn install directly via os-lib, with content-hash caching to skip redundant installs.
  • Renames the bundler-derived keys to new st-prefixed ones: npmDependenciesstNpmDependencies, npmDevDependenciesstNpmDevDependencies, useYarnstUseYarn; adds stNpmResolutions and stNpmInstall.
  • Updates scripted tests (sourcegen, sourcegen-mixed, japgolly) and docs to the new key names, and drops sbt-scalajs-bundler from their plugins.sbt.

This is a prerequisite refactor only — the actual sbt 2.0 cross-build (Scala 3 axis, pluginCrossBuild/crossSbtVersions, porting to sbt 2.0 APIs) is tracked separately in a follow-up PR.

Test plan

  • sbt-converter/compile and whole-build Test/compile succeed under JDK 17
  • sbt-converter/scripted (could not be verified in this sandbox due to a pre-existing, unrelated dependency-resolution issue reproduced identically on unmodified master; should be re-run in normal dev/CI)

https://claude.ai/code/session_01TBZdpjcwLC4C22494C7zNH

rleibman added 2 commits July 6, 2026 09:42
…npm install

sbt-scalajs-bundler has no sbt 2.0/Scala 3 build and appears dormant, which
blocks moving sbt-converter to sbt 2.0. sbt-converter never used its bundling
features (JS resource hooks were already stubbed to Nil) -- only its
npm-dependency declaration and npm-install plumbing.

Replaces it with a self-contained NpmInstall task that writes package.json
and runs npm/yarn install directly via os-lib, exposed via new
stNpmDependencies/stNpmDevDependencies/stNpmResolutions/stUseYarn/stNpmInstall
keys (renamed from the bundler's npmDependencies/useYarn/etc).

This is a prerequisite refactor only; the actual sbt 2.0 cross-build is
tracked separately.
@rleibman
rleibman requested a review from oyvindberg July 6, 2026 17:18
@rleibman

rleibman commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Hi! @oyvindberg! I hope it's ok, I had my AI draft this PR. I'm trying to move my projects to sbt 2.0 and I don't see any work on the sbt-converter towards that, the big stumbling block is the bundler, which I don't think is maintained, so this first PR is to remove the dependency with the bundler, and having the sbt plugin reproduce the parts that it made.

@oyvindberg

Copy link
Copy Markdown
Collaborator

Hey, long time!

I would be ok with many solutions here, really. I don't use sbt-scalajs-bundler or even sbt myself, so most of all i would like to nuke the sbt plugin from orbit 😅

but to be less dramatic, lets do something like you propose. i guess what i want to know is if there can be a well-defined hook which users of bundlers integrated with sbt can use? one thing has the responsibility of calling npm install, then ST needs to be called, and finally the results of ST needs to be appended to the resolved deps of the build. can you have your agent look into it? maybe consider it in relation with an sbt vite plugin as well? i seem to have an impression that exists

@rleibman

rleibman commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

the sbt-vite plugin is also dormant, I think the recommended approach is to use vite directly, but that's for scalajs end users, if I understand correctly, what sbt-scalajs-bundler was doing here was setting up which js the converter was going to convert. So even if you recommend to end users to use vite (or sbt-esbuild, which is another option) you still need a way to figure out what to convert, and that's why replacing it with this minimal implementation seems to make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants